﻿using Archiecture.API.Application.Commands.DeepCommand;
using Architercture.Domain.Service.IService;
using MediatR;
using Swork03_28.Domain.TraceableInfos;

namespace Archiecture.API.Application.CommandHandlers.DeepCommandHandler
{
    public class UpdateDeepProcessCommandHandler : IRequestHandler<UpdateDeepProcessCommand, int>
    {
        private readonly IDeepProcessService _deepServicel;

        public UpdateDeepProcessCommandHandler(IDeepProcessService deepServicel)
        {
            _deepServicel = deepServicel;
        }


        public async Task<int> Handle(UpdateDeepProcessCommand request, CancellationToken cancellationToken)
        {
            return await _deepServicel.UpdateDeepProcess(new DeepProcess
            {
                Principal = request.principal,
                BatchCode = request.batchCode,
                Certification = request.certification,
                GroupName = request.groupName,
                ProcessId = request.processId,
            });
        }
    }
}
